//
//  UIBarButtonItem+Extension.swift
//  weibo
//
//  Created by 陈经纬 on 16/7/20.
//  Copyright © 2016年 陈经纬. All rights reserved.
//

import UIKit


extension UIBarButtonItem{
    convenience  init(image: String,  target: AnyObject?, action: Selector) {
        
        let btn = UIButton()
        btn.setImage(UIImage(named: image), forState: UIControlState.Normal)
        btn.setImage(UIImage(named:image + "_highlighted" ), forState: UIControlState.Highlighted)
        btn.addTarget(target, action: action, forControlEvents: UIControlEvents.TouchUpInside)
        btn.sizeToFit()
        
        self.init(customView:btn)
    
        
        
    }
}

